#include "Logger.h"

namespace SUNSHINE
{
	void Logger::Environment()
	{
		char * ll = getenv("LOGGERLEVEL");

		if (NULL != ll)
		{
			this->level = INFO;
			return;
		}

		// 只比较第一个字符即可
		switch (ll[0])
		{
			case 'D':
			case 'd':
				this->level = DEBUG;
				break;
			case 'E':
			case 'e':
				this->level = ERROR;
				break;
			case 'F':
			case 'f':
				this->level = FATAL;
				break;
			default:
				this->level = INFO;
				break;
		}
	}
}
